Simulation #1

Data structure: \(O = (W, A, Z, Y)\)

  • U - exogenous variables
  • W - baseline covariate that is a measure of body condition
  • A - treatment level based on W, continuous between 0 and 5
  • Z - intermediate curve based on W and A
  • Y - outcome, indicator of an event ?

Underlying data generating process, \(P_{U,X}\)

  • Exogenous variables:
    • \(U_A \sim Normal(\mu=0, \sigma^2 = 1^2)\)
    • \(U_A \sim Normal(\mu=0, \sigma^2 = 2^2)\)
    • \(U_Z \sim Uniform(min = 0, max = 1)\)
    • \(U_Y \sim Uniform(min = 0, max = 1)\)
  • Structural equations F and endogenous variables:
    • \(W = U_W\)
    • \(A = bound(2 - 0.5W + U_A, min=0, max=5)\)
    • \(Z = \mathbf{I}[U_Z < expit(2-W-A)]\)
    • \(Y = \mathbf{I}[U_Y < expit(W + 5*A + Z - 0.5 * W * A - 8)]\)
##        W                   A                Z                Y         
##  Min.   :-3.433710   Min.   :0.0000   Min.   :0.0000   Min.   :0.0000  
##  1st Qu.:-0.666448   1st Qu.:0.5927   1st Qu.:0.0000   1st Qu.:0.0000  
##  Median : 0.000989   Median :2.0101   Median :0.0000   Median :1.0000  
##  Mean   :-0.003005   Mean   :2.1186   Mean   :0.4876   Mean   :0.5959  
##  3rd Qu.: 0.671048   3rd Qu.:3.4182   3rd Qu.:1.0000   3rd Qu.:1.0000  
##  Max.   : 4.029183   Max.   :5.0000   Max.   :1.0000   Max.   :1.0000
## Summary of A given W < -1:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   1.355   2.782   2.717   4.122   5.000
## Summary of A given -1 < W <= 0:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.9052  2.2917  2.3253  3.6198  5.0000
## Summary of A given 0 < W <= 1:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.4188  1.7464  1.9330  3.1403  5.0000
## Summary of A given 1 < W:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   0.000   1.034   1.466   2.557   5.000

## 
## Call:
## glm(formula = Y ~ W + A + W * A + Z, family = binomial, data = obs)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -3.8730  -0.0709   0.0006   0.0565   3.6852  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -7.8123     0.2514 -31.077  < 2e-16 ***
## W             1.0557     0.1878   5.620 1.91e-08 ***
## A             4.9037     0.1418  34.573  < 2e-16 ***
## Z             0.8761     0.1168   7.499 6.44e-14 ***
## W:A          -0.5106     0.1218  -4.192 2.77e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 13492.8  on 9999  degrees of freedom
## Residual deviance:  2557.9  on 9995  degrees of freedom
## AIC: 2567.9
## 
## Number of Fisher Scoring iterations: 9
## [1] "    MSE: 387.2631, AUC: 0.9897"

n = 200

CV HAL

results

## CV selected lambda (from one sample): 0.0086251603748726

1000 repetition

## The average of CV selected lambdas (from 1000 sample): 0.00793684388619338 The average of CV selected lambdas (from 1000 sample): 0.00792057260113451 The average of CV selected lambdas (from 1000 sample): 0.00792340491044921
## z=1:

## z=0:

Globally Undersmoothed HAL

results

## Undersmoothed lambda: 0.00010990826113378
##  which is 0.0127427498570313 * lambda_CV

1000 repetition

## The average of unsersmoothed lambda (from 1000 sample): 0.000110282693674584
##  which is 0.0144431693912157 * the average of 1000 lambda_CV
## z=1:

## z=0:

Oevr a grid of lambda scalers

## TableGrob (7 x 4) "arrange": 7 grobs
##   z     cells    name                 grob
## 1 1 (2-3,2-3) arrange       gtable[layout]
## 2 2 (4-5,1-2) arrange       gtable[layout]
## 3 3 (4-5,3-4) arrange       gtable[layout]
## 4 4 (6-7,1-2) arrange       gtable[layout]
## 5 5 (6-7,3-4) arrange       gtable[layout]
## 6 6 (3-3,4-4) arrange    gtable[guide-box]
## 7 7 (1-1,1-4) arrange text[GRID.text.1916]

## TableGrob (7 x 4) "arrange": 7 grobs
##   z     cells    name                 grob
## 1 1 (2-3,2-3) arrange       gtable[layout]
## 2 2 (4-5,1-2) arrange       gtable[layout]
## 3 3 (4-5,3-4) arrange       gtable[layout]
## 4 4 (6-7,1-2) arrange       gtable[layout]
## 5 5 (6-7,3-4) arrange       gtable[layout]
## 6 6 (3-3,4-4) arrange    gtable[guide-box]
## 7 7 (1-1,1-4) arrange text[GRID.text.2192]

## TableGrob (7 x 4) "arrange": 7 grobs
##   z     cells    name                 grob
## 1 1 (2-3,2-3) arrange       gtable[layout]
## 2 2 (4-5,1-2) arrange       gtable[layout]
## 3 3 (4-5,3-4) arrange       gtable[layout]
## 4 4 (6-7,1-2) arrange       gtable[layout]
## 5 5 (6-7,3-4) arrange       gtable[layout]
## 6 6 (3-3,4-4) arrange    gtable[guide-box]
## 7 7 (1-1,1-4) arrange text[GRID.text.2468]